

***************************************************************
*********************2008 ANES Time-Series*********************
***************************************************************

*********************	Ideology      

***R ideological self-placement
gen ideo7 = V083069
recode ideo7 -9/0=. 
*range 1 (exr lib) to 7 (exr conserv)

*********************	Partisanship

***R party self-placement
gen pid7 = V083098x
recode pid7 -9/-1=.
replace pid7 = pid7+1
*range 1 (str dem) to 7 (str repub)

***3-cat party

gen pid3 = pid7
recode pid3 1/3=1 4=2 5/7=3

*********************	Sorting

gen pidstr = abs(pid7-4)+1
gen ideostr = abs(ideo7-4)+1

gen overlap = abs(ideo7-pid7)+1
omscore overlap 
replace overlap = rr_overlap

gen sorting = pidstr*ideostr*overlap
replace sorting = (sorting-7)/105

*********************	Emotion

***FEAR: Dem
gen demfear = V083063
recode demfear -9/-1=. 5=0
gen demfearoften = V083063a
recode demfearoften -9/-1=. 4=1 3=2 2=3 1=4
replace demfear = demfearoften if demfear==1
label define emotionrange 0 "no / never" 4 "very often"
label value demfear emotionrange

***FEAR: Rep
gen repfear = V083067
recode repfear -9/-1=. 5=0
gen repfearoften = V083067a
recode repfearoften -9/-1=. 4=1 3=2 2=3 1=4
replace repfear = repfearoften if repfear==1
label value repfear emotionrange

***ANGER: Dem
gen demangry = V083061
recode demangry -9/-1=. 5=0
gen demangryoften = V083061a
recode demangryoften -9/-1=. 4=1 3=2 2=3 1=4
replace demangry = demangryoften if demangry==1
label value demangry emotionrange

***ANGER: Rep
gen repangry = V083065
recode repangry -9/-1=. 5=0
gen repangryoften = V083065a
recode repangryoften -9/-1=. 4=1 3=2 2=3 1=4
replace repangry = repangryoften if repangry==1
label value repangry emotionrange

***HOPE: Dem
gen demhope = V083062
recode demhope -9/-1=. 5=0
gen demhopeoften = V083062a
recode demhopeoften -9/-1=. 4=1 3=2 2=3 1=4
replace demhope = demhopeoften if demhope==1
label value demhope emotionrange

***HOPE: Rep
gen rephope = V083066
recode rephope -9/-1=. 5=0
gen rephopeoften = V083066a
recode rephopeoften -9/-1=. 4=1 3=2 2=3 1=4
replace rephope = rephopeoften if rephope==1
label value rephope emotionrange

***PRIDE: Dem
gen dempride = V083064
recode dempride -9/-1=. 5=0
gen demprideoften = V083064a
recode demprideoften -9/-1=. 4=1 3=2 2=3 1=4
replace dempride = demprideoften if dempride==1
label value dempride emotionrange

***PRIDE: Rep
gen reppride = V083068
recode reppride -9/-1=. 5=0
gen repprideoften = V083068a
recode repprideoften -9/-1=. 4=1 3=2 2=3 1=4
replace reppride = repprideoften if reppride==1
label value reppride emotionrange

***root variables
*dem afraid	= V083063, frequeny follow-up: V083063a
*rep afraid	= V083067, frequeny follow-up: V083067a
*dem angry	= V083061, frequeny follow-up: V083061a
*rep angry	= V083065, frequeny follow-up: V083065a
*dem hope	= V083062, frequeny follow-up: V083062a
*rep hope	= V083066, frequeny follow-up: V083066a
*dem proud	= V083064, frequeny follow-up: V083064a
*rep proud	= V083068, frequeny follow-up: V083068a



*********************	Issues (respondent self-placement)

***R govt assistance to blacks
gen rblacks = V083137
recode rblacks -9/0=. 
*lib low, con high

***R insurance
gen rinsur = V083119
recode rinsur -9/0=. 
*lib low, con high

***R jobs
gen rjobs = V083128
recode rjobs -9/0=. 
*lib low, con high

***R environment
gen renviron = V083154
recode renviron -9/0=. 
*lib low, con high

***R women's role
gen rwomen = V083166
recode rwomen -9/0=. 
*lib low, con high

***R abortion
gen rabort = V085086
recode rabort -9/-1=. 1=7 2=5 3=3 4=1 5/99=. 
*lib low, con high

***R defense
gen rdefense = V083112
recode rdefense -9/0=. 
*lib low, con high

***R gov spending
gen rspend = V083105
recode rspend -9/0=. 1=7 2=6 3=5 4=4 5=3 6=2 7=1
*lib low, con high

*********************	Issues (Republican candidate placements)

***Rep Party govt assistance to blacks
gen repcand_blacks = V083139b
recode repcand_blacks -9/0=. 
*coded lib-con in original, 1-7

***Rep Party insurance
gen repcand_insur = V083121b
recode repcand_insur -9/0=. 
*coded lib-con in original, 1-7

***Rep Party jobs
gen repcand_jobs = V083130b
recode repcand_jobs -9/0=.
*coded lib-con in original, 1-7

***Rep Party environment
gen repcand_environ = V083156b
recode repcand_environ -9/0=. 
*coded lib-con in original, 1-7

***Rep Party women's role
gen repcand_women = V083168b
recode repcand_women -9/0=. 
*coded lib-con in original, 1-7

***Rep Party abortion
gen repcand_abort = V085089b
recode repcand_abort -9/0=. 1=7 2=5 3=3 4=1 5/99=. 

***Rep Party defense
gen repcand_defense = V083114b
recode repcand_defense -9/0=. 
*coded lib-con in original, 1-7

***Rep Party gov spending
gen repcand_spend = V083107b
recode repcand_spend -9/0=. 7=1 6=2 5=3 4=4 3=5 2=6 1=7 
*coded con-lib in original

*********************	Issues (Democratic candidate placements)

***Dem Party govt assistance to blacks
gen demcand_blacks = V083139a
recode demcand_blacks -9/0=. 
*coded lib-con in original, 1-7

***Dem Party insurance
gen demcand_insur = V083121a
recode demcand_insur -9/0=.
*coded lib-con in original, 1-7

***Dem Party jobs
gen demcand_jobs = V083130a
recode demcand_jobs -9/0=. 
*coded lib-con in original, 1-7

***Dem Party environment
gen demcand_environ = V083156a
recode demcand_environ -9/0=. 
*coded lib-con in original, 1-7

***Dem Party women's role
gen demcand_women = V083168a
recode demcand_women -9/0=.
*coded lib-con in original, 1-7

***Dem Party abortion
gen demcand_abort = V085089a
recode demcand_abort -9/0=. 1=7 2=5 3=3 4=1 5/99=. 

***Dem Party defense
gen demcand_defense = V083114a
recode demcand_defense -9/0=. 
*coded lib-con in original, 1-7

***Dem Party gov spending
gen demcand_spend = V083107a
recode demcand_spend -9/0=. 7=1 6=2 5=3 4=4 3=5 2=6 1=7 
*coded con-lib in original

*********************	Party thermometers

gen demcandtherm = V083037a 
recode demcandtherm -9/-1=. 

gen repcandtherm = V083037b
recode repcandtherm -9/-1=. 

gen bias = abs(demcandtherm-repcandtherm)

*********************	Additional covariates

***knowledge
gen knowmaj = (V085066==5)
gen knowchief = (V085123a==1)
gen knowprime = (V085122a==1)
gen knowspeaker = (V085120a==1)
gen knowvice = (V085121a==1)
egen knowledge = rmean(knowmaj knowchief knowprime knowspeaker knowvice)

***education
gen educ  = V083218x
recode educ -9/-1=.

***race
gen white = (V081102==1)
gen black = (V081102==2)

***age
gen age = V081104 

***male
gen male = (V081101==1)

***news consumption
recode newsconsumption -9/-1=.
gen newsconsumption_new = V083024
recode newsconsumption_new -9/-1=.
replace newsconsumption = newsconsumption_new if newsconsumption==.

***************************************************************
*********************	Analyses

regress sorting demfear repfear demangry repangry demhope rephope dempride reppride knowledge educ white black age male newsconsumption [pweight=V080101], robust
outreg, se bdec(2) starloc(1) replace
regress sorting demfear repfear demangry repangry demhope rephope dempride reppride knowledge educ white black age male newsconsumption if pid3==1 [pweight=V080101], robust
outreg, se bdec(2) starloc(1) merge
regress sorting demfear repfear demangry repangry demhope rephope dempride reppride knowledge educ white black age male newsconsumption if pid3==3 [pweight=V080101], robust
outreg, se bdec(2) starloc(1) merge

**with thermometers

regress sorting demcandtherm repcandtherm demfear repfear demangry repangry demhope rephope dempride reppride knowledge educ white black age male newsconsumption [pweight=V080101], robust
outreg, se bdec(2) starloc(1) replace
regress sorting demcandtherm repcandtherm demfear repfear demangry repangry demhope rephope dempride reppride knowledge educ white black age male newsconsumption if pid3==1 [pweight=V080101], robust
outreg, se bdec(2) starloc(1) merge
regress sorting demcandtherm repcandtherm demfear repfear demangry repangry demhope rephope dempride reppride knowledge educ white black age male newsconsumption if pid3==3 [pweight=V080101], robust
outreg, se bdec(2) starloc(1) merge

**with measure of bias (relative therm)

regress sorting bias demfear repfear demangry repangry demhope rephope dempride reppride knowledge educ white black age male newsconsumption [pweight=V080101], robust
outreg, se bdec(2) starloc(1) replace
regress sorting bias demfear repfear demangry repangry demhope rephope dempride reppride knowledge educ white black age male newsconsumption if pid3==1 [pweight=V080101], robust
outreg, se bdec(2) starloc(1) merge
regress sorting bias demfear repfear demangry repangry demhope rephope dempride reppride knowledge educ white black age male newsconsumption if pid3==3 [pweight=V080101], robust
outreg, se bdec(2) starloc(1) merge
